package wt.hpad.model.adapter;

import android.app.Activity;
import android.content.Context;
import android.view.ViewGroup;

import java.util.List;

import wt.hpad.R;
import wt.hpad.base.BaseHolder;
import wt.hpad.base.BaseRvSwAdapter;
import wt.hpad.model.bean.DishDetail;
import wt.hpad.model.holder.DishCartSwHolder;

/**
 * Created by wt on 1.3.
 */

public class DishCartAdapter extends BaseRvSwAdapter<DishDetail> {

    private final Activity mActivity;

    public DishCartAdapter(Activity activity, List<DishDetail> mDatas, Context mContext) {
        super(activity, mDatas, mContext);
        mActivity = activity;
    }

    @Override
    protected BaseHolder createViewHolder(Context context, ViewGroup parent, int viewType) {
        DishCartSwHolder holder = new DishCartSwHolder(context, parent, this, R.layout.item_dish_cart);
        holder.setActivity(mActivity);
        return holder;
    }

    @Override
    protected int getItemType(int position) {
        return BaseRvSwAdapter.TYPE_SWIPE;
    }

    @Override
    protected int getRId(int position) {
        return R.id.swipe_dishcart;
    }
}
